import Logger from "../Logger/Logger";

/**
 * Window变量加载
 */
export default class WindowLoader {
    private static instance: WindowLoader = new WindowLoader();
    /**
     * Window变量加载
     */
    public static get Default(): WindowLoader {
        return this.instance;
    }

    constructor() {
        window.addEventListener('unload', this.Dispose.bind(this));
    }

    Dispose() {
        window.removeEventListener('unload', this.Dispose);
    }

    public Initialize(): void {
        window.Logger = Logger.Default;
    }
}